unit MDI;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;

type
  TMDIChild = class(TForm)
  private
    { Private declarations }
    procedure wmMdiActivate(var Msg: TMessage); message WM_MDIACTIVATE;
  public
    { Public declarations }
  end;

implementation

{$R *.DFM}

{ TMDIChild }

procedure TMDIChild.wmMdiActivate(var Msg: TMessage);
begin
  if WindowState = wsMaximized then begin
    SendMessage(Handle, WM_SIZE, SIZE_RESTORED, 0);
    SendMessage(Handle, WM_SIZE, SIZE_MAXIMIZED, 0);
  end;
  inherited;
end;

end.
